package main.java.com.fronted.css;

import javax.swing.*;
import javax.swing.border.LineBorder;
import java.awt.*;

public class Meta_cosmic extends JFrame{
    public void enter_meta_cosmic(){
        JFrame frame1 = new JFrame("Meta_cosmic");
        frame1.setLayout(null);
        frame1.setResizable(false);

        JLabel l0 = new JLabel("<html>NOTICE!</html>");
        l0.setForeground(Color.black);
        l0.setFont(new Font("Times New Roman", Font.BOLD, 35));
        l0.setBounds(0,0,1000,35);
        frame1.add(l0);

        JLabel l1 = new JLabel("<html>Welcome to Meta_cosmic, this is about a game to drive a spaceship.</html>");
        l1.setForeground(Color.black);
        l1.setFont(new Font("Times New Roman", Font.BOLD, 20));
        l1.setBounds(0,20,1000,50);
        frame1.add(l1);

        JLabel l2 = new JLabel("<html>yHere is a table about the parameters of the spaceship, normally the parameters are default.</html>");
        l2.setForeground(Color.black);
        l2.setFont(new Font("Times New Roman", Font.BOLD, 20));
        l2.setBounds(0,40,1000,50);
        frame1.add(l2);

        JLabel l3 = new JLabel("<html>you can set some parameters to set your own universe!</html>");
        l3.setForeground(Color.black);
        l3.setFont(new Font("Times New Roman", Font.BOLD, 20));
        l3.setBounds(0,60,1000,50);
        frame1.add(l3);

        JLabel l4 = new JLabel("<html>if you want to revise it, please enter your number.</html>");
        l4.setForeground(Color.black);
        l4.setFont(new Font("Times New Roman", Font.BOLD, 20));
        l4.setBounds(0,80,1000,50);
        frame1.add(l4);


        //this is a table
        JPanel pan=(JPanel)frame1.getContentPane();
            pan.setOpaque(false);

        //下面为程序工作核心面板
        Object[][] data = {
                {"物理量参数", "数值", "简称"},
                {"重力", 9.8, "G"},
                {"压强", 115, "P"},
                {"磁场强度","1245T", "B"},
                {"角动量","2345","R"},
                {"地心引力",34,"M"},
                {"台空军飞行器质量",87,"m"},
                {"飞行器初始速度","24","v"},
                {"...","...","..."}
        };

        // 创建表格列名
        String[] columnNames = {"Name", "Age", "Country"};

        // 创建 JTable 对象，并将数据和列名传入
        JTable table = new JTable(data, columnNames);

        table.setBounds(0,130,600,170);
        table.setBorder(new LineBorder(Color.BLACK));
        table.getColumnModel().getColumn(0).setPreferredWidth(100);
        table.getColumnModel().getColumn(1).setPreferredWidth(50);
        table.getColumnModel().getColumn(2).setPreferredWidth(150);

        // 创建滚动面板，并将表格添加到滚动面板中
        JScrollPane scrollPane = new JScrollPane(table);
        frame1.add(scrollPane);
        frame1.add(table);

        //设置按钮直接进入游戏导航页面
        JButton j1 = new JButton("开始您的飞行模拟过程");
        j1.setLayout(null);
        j1.setBounds(100,320,350,30);
        frame1.add(j1);


        frame1.setVisible(true);
        frame1.setSize(800, 540);
        frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    }

    public static void main(String[] args) {
        new Meta_cosmic().enter_meta_cosmic();
    }

}
